module.exports.of = function of (edge) {
  const MessageBoxButtons = {
    OK: 'OK',
    OKCancel: 'OKCancel',
    AbortRetryIgnore: 'AbortRetryIgnore',
    YesNoCancel: 'YesNoCancel',
    YesNo: 'YesNo',
    RetryCancel: 'RetryCancel'
  }

  const MessageBoxIcon = {
    None: 'None',
    Hand: 'Hand',
    Stop: 'Stop',
    Error: 'Error',
    Question: 'Question',
    Exclamation: 'Exclamation',
    Warning: 'Warning',
    Asterisk: 'Asterisk',
    Information: 'Information'
  }

  const messageBox = edge.func(function () { /*
         #r "System.Windows.Forms.dll"
         using System.Windows.Forms;
         using System.Collections.Generic;
         async(input) =>
         {
            IDictionary<string, MessageBoxButtons> enumButtons = new Dictionary<string, MessageBoxButtons>();
            enumButtons["OK"] = MessageBoxButtons.OK;
            enumButtons["OKCancel"] = MessageBoxButtons.OKCancel;
            enumButtons["AbortRetryIgnore"] = MessageBoxButtons.AbortRetryIgnore;
            enumButtons["YesNoCancel"] = MessageBoxButtons.YesNoCancel;
            enumButtons["YesNo"] = MessageBoxButtons.YesNo;
            enumButtons["RetryCancel"] = MessageBoxButtons.RetryCancel;
            IDictionary<string, MessageBoxIcon> enumIcons = new Dictionary<string, MessageBoxIcon>();
            enumIcons["None"] = MessageBoxIcon.None;
            enumIcons["Hand"] = MessageBoxIcon.Hand;
            enumIcons["Stop"] = MessageBoxIcon.Stop;
            enumIcons["Error"] = MessageBoxIcon.Error;
            enumIcons["Question"] = MessageBoxIcon.Question;
            enumIcons["Exclamation"] = MessageBoxIcon.Exclamation;
            enumIcons["Warning"] = MessageBoxIcon.Warning;
            enumIcons["Asterisk"] = MessageBoxIcon.Asterisk;
            enumIcons["Information"] = MessageBoxIcon.Information;
            dynamic arg=(dynamic)input;
            string message=(String)arg.message;
            string title=(String)arg.title;
            MessageBoxButtons buttons=enumButtons["YesNoCancel"];
            MessageBoxIcon icon=enumIcons["None"];
            if(((IDictionary<string, object>)arg).ContainsKey("buttons")) buttons=enumButtons[(string)arg.buttons];
            if(((IDictionary<string, object>)arg).ContainsKey("icon")) icon=enumIcons[(string)arg.icon];
            return MessageBox.Show(message,title,buttons,icon);
         }
*/
  })

  let show = (message = '', title = '', buttons = MessageBoxButtons.OK, icon = MessageBoxIcon.None) => {
    messageBox({ message: message, title: title, buttons: buttons, icon: icon }, function (error, result) {
      if (error) throw error
      console.log(result)
    })
  }

  return {
    show,
    MessageBoxButtons,
    MessageBoxIcon
  }
}
